@@ -0,0 +1,19 @@ |
||
1 |
+# Increase handler size to 16MB (consistent with events.payload) |
|
2 |
+ |
|
3 |
+class ChangeHandlerToMediumText < ActiveRecord::Migration |
|
4 |
+ def up |
|
5 |
+ if mysql? |
|
6 |
+ change_column :delayed_jobs, :handler, :text, :limit => 16777215 |
|
7 |
+ end |
|
8 |
+ end |
|
9 |
+ |
|
10 |
+ def down |
|
11 |
+ if mysql? |
|
12 |
+ change_column :delayed_jobs, :handler, :text, :limit => 65535 |
|
13 |
+ end |
|
14 |
+ end |
|
15 |
+ |
|
16 |
+ def mysql? |
|
17 |
+ ActiveRecord::Base.connection.adapter_name =~ /mysql/i |
|
18 |
+ end |
|
19 |
+end |